package com.atguigu.cmsservice.Api;

import com.atguigu.cmsservice.entity.CrmBanner;
import com.atguigu.cmsservice.service.CrmBannerService;
import com.atguigu.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "前端展示")
@CrossOrigin
@RestController
@RequestMapping("cmsservice/banner")
public class CrmBannerApiController {
@Autowired
    private  CrmBannerService crmBannerService;


@ApiOperation(value = "获取轮播图")
    @GetMapping("getAllBanner")
    public R getAllBanner(){
    List<CrmBanner> bannerList = crmBannerService.getBanner();
    return  R.ok().data("bannerList",bannerList);
}

}
